<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">  
  <title>家具详细列表</title>
 </head>
 <body>
 <?php
  require_once('system/dbConnect.php');
    require_once('system/MyFunc.php'); 
  connect();
     $sql="select * from jiaju where wn_id={$id}";
  if(empty($_GET['id'])){
    $sql = 'select * from jiaju';
  }
  else{
    $sql='select * from jiaju where wn_id='.$_GET['id'];
  }
  $result = fetch_array($sql); 
 ?>
 <center><h3>家具列表</h3></center>
 <table align="center" width="80%" border=1> 
 <tr>
   <th>家具图片</th>
   <th>家具名称</th>
   <th>家具品牌</th>
   <th>家具介绍</th>
   <th>审核状态</th>
 </tr>
 <?php
  foreach ($result as $row) {
	 echo '<tr>';
	 echo '<td align="center"><img src=upload/'.$row['wn_jiajulink'].' width=60 height=80 alt="无图片"></td>'; 
   echo '<td>'.$row['wn_name'].'</td>';
   echo '<td>'.$row['wn_brand'].'</td>';	 	 
   echo '<td>'.$row['wn_intro'].'</td>';
   echo '<td>'.$row['wn_ischecked'].'</td>';
	 echo '</tr>';  
  }
  echo '</table>';  
  $totalrows = count($result);
  echo "<table align='center'><tr><td>共有{$totalrows}条家具记录</td></tr></table>";   
 ?>
 
 </body>
</html>
